home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 076-100 / disk_092 / as6502 / user.nr < prev   
Text File  |  1992-05-06  |  5KB  |  190 lines

  1. .de hd
  2. 'sp 3
  3. .tl ''\fBas6502 User Notes\fR'Page %'
  4. 'sp 2
  5. ..
  6. .de fo
  7. 'bp
  8. ..
  9. .wh 0 hd
  10. .wh -3 fo
  11. .br
  12. \fBSOURCE LINE FORMAT\fR:
  13. .ti 0.5i
  14. .sp 1
  15. <label> <operation> <operand> <comment>
  16. .sp 1
  17. Each field is terminated by one or more spaces, a tab or a ';' (which
  18. begins the comment field immediately).
  19. .sp
  20. \fBLABEL FIELD\fR:
  21. .sp 1
  22. If first character is ';', entire line is a comment.
  23. If first character is space, label field is null.
  24. Labels are alphanumeric strings beginning
  25. with 'a' through 'z', 'A' through 'Z',
  26. underscore or period followed by any of the above
  27. characters or '0' through '9'.
  28. Currently, labels are limited to 19 characters.
  29. A, X, Y, a, x and y are reserved labels.
  30. .sp
  31. \fBOPERATION FIELD\fR:
  32. .sp 1
  33. Upper and lower case letters are equivalent.
  34. Machine operation mnemonics are:
  35. .in 0.5i
  36. .nf
  37. .sp 1
  38. ADC     BMI     CLD     DEX     JSR     PHA     RTS     STY
  39. AND     BNE     CLI     DEY     LDA     PHP     SBC     TAX
  40. ASL     BPL     CLV     EOR     LDX     PLA     SEC     TAY
  41. BCC     BRK     CMP     INC     LDY     PLP     SED     TSX
  42. BCS     BVC     CPX     INX     LSR     ROL     SEI     TXA
  43. BEQ     BVS     CPY     INY     NOP     ROR     STA     TXS
  44. BIT     CLC     DEC     JMP     ORA     RTI     STX     TYA
  45. .in 0
  46. .fi
  47. .sp 1
  48. Pseudo operation mnemonics are:
  49. .in 1.2i
  50. .ti 0.5i
  51. .sp 1
  52. =      equate label name to operand field value
  53. (space is not needed to terminate this operation).
  54. .ti 0.5i
  55. *=     set location counter to operand field value
  56. (space is not needed to terminate this operation).
  57. .ti 0.5i
  58. .tr*.
  59. *WORD  assign 16 bit value of operand field to next
  60. two locations; low byte of value first, then high byte.
  61. .ti 0.5i
  62. *DBYT  assign 16 bit value of operand field to next
  63. two locations; high byte of value first, then low byte.
  64. .ti 0.5i
  65. *BYTE  assign 8 bit value of operand field to next
  66. location.
  67. .ti 0.5i
  68. *NLST  turn listing mode off (this source
  69. line is not listed).
  70. .ti 0.5i
  71. *LIST  turn listing mode on (normal mode) (this
  72. source line is not listed).
  73. .ti 0.5i
  74. *PAGE  start a new listing page.
  75. Optionally specify a title for the page heading.
  76. (this source line is not listed).
  77. .tr**
  78. .in 0
  79. .sp 1
  80. \fBOPERAND FIELD\fR:
  81. .sp 1
  82. Operand field expressions use infix notation and are evaluated strictly
  83. from left to right.
  84. No imbedded spaces are permitted.
  85. .sp 1
  86. Operand field terms include labels and numbers.
  87. Asterisk (*) is the label for the location counter value.
  88. Numbers are binary, octal, decimal, hexadecimal or ASCII.
  89. Number type is indicated by the first character of the number string as follows:
  90. .nf
  91. .in 0.5i
  92. .sp 1
  93. %       binary prefix
  94. @ or 0  octal prefix
  95. 1 - 9   decimal by default (prefix is part of number)
  96. $       hexadecimal prefix
  97. .tr,'
  98. ,       ASCII character prefix
  99. .tr,,
  100. "       ASCII character string prefix and suffix; in the
  101.         string, \\t is a tab character, \\n is a new line.
  102. .in 0
  103. .fi
  104. .sp 1
  105. Operand field operations and the corresponding symbols are:
  106. .in 0.5i
  107. .nf
  108. .sp 1
  109. +       addition
  110. -       subtraction
  111. /       division
  112. *       multiplication
  113. %       modulo (remainder after integer division)
  114. ^       logical exclusive OR
  115. &       logical AND
  116. |       logical OR
  117. <       low byte
  118. >       high byte
  119. .in 0
  120. .fi
  121. .sp 1
  122. Addressing modes are represented as follows:
  123. .in 0.5i
  124. .nf
  125.  lda =aa      immediate addressing
  126.  lda #aa      immediate addressing, alternate
  127.  lda D           direct addessing
  128.  LDA aa      page zero addressing, aa < 256
  129.  asl A           accumulator addressing
  130.  brk           implied addressing
  131.  lda (aa,X)      indirect,X addressing
  132.  lda (aa),Y      indirect,Y addressing
  133.  lda aa,X      zero page,X addressing
  134.  lda D,X      absolute,X addressing
  135.  lda D,Y      absolute,Y addressing
  136.  bcc *-$10      relative addressing
  137.  jmp (D)      indirect addressing
  138.  ldx aa,Y      zero page,Y addressing
  139. .fi
  140. .sp 1
  141. \fBERROR MESSAGES\fR:
  142. .in 0.5i
  143. .nf
  144. .sp 1
  145. Invalid operation code
  146. Invalid argument count (when as6502 was invoked)
  147. Open error for file
  148. Creat error for object file 6502.out
  149. Close error
  150. Close error (6502.out)
  151. Symbol table full
  152. Label multiply defined
  153. Sync error (pass 1 symbol value not equal pass 2 symbol value)
  154. Invalid branch address
  155. Operand field missing
  156. Invalid addressing mode
  157. Operand field size error
  158. Undefined symbol in operand field
  159. Invalid operand field
  160. .fi
  161. .in 0
  162. .sp 1
  163. \fBINVOKING as6502\fR:
  164. .sp 1
  165. .ti 0.5i
  166. as6502 {-ilnmos} {-p -t -w } <source files descriptions>
  167. .sp 1
  168. Options:
  169. .in 0.5i
  170. .nf
  171. .sp 1
  172. -i   ignore any .nlst pseudo operations
  173. -l   list errors only
  174. -n   print addresses as <high byte><low byte>,
  175.      rather than as <low byte>:<high byte>.
  176. -o   generate ASCII object output in file 6502.out,
  177.      format is
  178.           ;<address lo><address hi><data>
  179. -s   print symbol table at end of listing
  180. -m   output the object file in standard MOS Technology format.
  181. .sp 2
  182. Parameters:
  183. .in 0.5i
  184. .nf
  185. -p   specify the page length.
  186. -t   specify the symbol table size.
  187. -w   specify the print line size.
  188.  
  189.                 J. H. Van Ornum, JHS  3/3/87
  190.